package com.myjoje.config;

import com.myjoje.config.interceptor.ErrorPageInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyWebMvcConfigurer implements WebMvcConfigurer {

    /**
     * 添加拦截器
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        //登陆拦截器
//        registry.addInterceptor(new LoginInterceptor())
//                .excludePathPatterns("/static/**")
//                .addPathPatterns("/**");
//        //日志拦截器
//        registry.addInterceptor(new LoggerInterceptor())
//                .excludePathPatterns("/static/**")
//                .addPathPatterns("/**");
//        registry.addInterceptor(new ErrorPageInterceptor())
//                .excludePathPatterns("/pub/login");
    }

    /**
     * 静态文件处理
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {

    }
}
